/**
 *
 */
package org.suren.littlebird.ssh;

import java.lang.reflect.InvocationTargetException;

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.operation.IRunnableWithProgress;

import com.jcraft.jsch.SftpProgressMonitor;

/**
 * @author suren
 *
 */
public class TestMonitor implements SftpProgressMonitor, IRunnableWithProgress
{
	private long maxCount;
	private long nowCount;

	/* (non-Javadoc)
	 * @see com.jcraft.jsch.SftpProgressMonitor#count(long)
	 */
	@Override
	public boolean count(long arg0)
	{
		System.out.println("count");
		return true;
	}

	/* (non-Javadoc)
	 * @see com.jcraft.jsch.SftpProgressMonitor#end()
	 */
	@Override
	public void end()
	{
	}

	/* (non-Javadoc)
	 * @see com.jcraft.jsch.SftpProgressMonitor#init(int, java.lang.String, java.lang.String, long)
	 */
	@Override
	public void init(int op, String src, String dest, long max)
	{
		maxCount = max;
		nowCount = 0;
		System.out.println("init");
	}

	/* (non-Javadoc)
	 * @see org.eclipse.jface.operation.IRunnableWithProgress#run(org.eclipse.core.runtime.IProgressMonitor)
	 */
	@Override
	public void run(IProgressMonitor monitor) throws InvocationTargetException,
			InterruptedException
	{
		monitor.beginTask("str", 60);

		Thread.sleep(3000);

		monitor.subTask("sdasfasfasdf");

		Thread.sleep(3000);

		monitor.done();
	}

}
